home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 19 / Mac Magazin and MacEasy Magazine CD - Issue 19.iso / Utilities / uae-0.4 / README < prev    next >
Text File  |  1996-02-13  |  21KB  |  445 lines

  1. This is version 0.3 of UAE, the Un*x Amiga Emulator.
  2.  
  3. 1. <drivel.h>
  4.  
  5. Copyright 1995, 1996 Bernd Schmidt & contributors (see below). This program is
  6. freeware.  You may do whatever you want with it for personal use. Permission 
  7. is granted to redistribute this program free of charge, provided it is 
  8. distributed in the full archive with unmodified contents and no profit beyond 
  9. the price of the media on which it is distributed is made. Exception: It may 
  10. be included on freeware/shareware collections on CD-ROM.
  11. There are no warranties of any kind for this program. If you use this program,
  12. you do so at your own risk. The authors are not responsible for any damages 
  13. that might result from using this program.
  14. This program is still in an early development stage. It contains bugs and is
  15. not user-friendly. 
  16.  
  17. 2. What you need to get it to work
  18.  
  19.   - a Un*x system with the X Window System, or, if you use Linux, SVGAlib.
  20.     X is much more stable and not that much slower, so use X if possible.
  21.     SVGAlib can get your system into an unusable state if it crashes. You
  22.     have been warned.
  23.   - A graphics card that lets you use a resolution of at least 800x600 in
  24.     65536 colors. You can compile UAE for 256 color screens, but the colors
  25.     will not be quite as good.
  26.   - a C compiler. An _ANSI_ C compiler. What most workstation vendors ship
  27.     is not a compiler, but a nightmare. Use GCC if it is available.
  28.   - A Kickstart ROM file. I've heard success reports with Kickstart 1.3, 2.0,
  29.     3.0 and 3.1 from various people.
  30.     There seem to exist special 68020+ versions of newer Kickstarts. These 
  31.     will not work, neither will EPROM versions, and neither will ZKick files.
  32.     Please don't ask me to send you one, I have not asked Commodore/Escom for
  33.     permission yet, and until I do, I won't give any away.
  34.     This version of the emulator can also boot some programs without a
  35.     Kickstart. See below for more information.
  36.  
  37. I've successfully tested UAE on the following systems:
  38.   - Pentium-90, Linux 1.3.45; X11R6 (XFree86 3.1.1) / SVGAlib 1.2.9, GCC 2.7.2
  39.   - HP Apollo, HP-UX, X11R5, GCC 2.6.0
  40.   - Sun Sparcstation, Solaris, OpenWindows, GCC 2.6.1
  41.  
  42. Several people have successfully run previous versions on a variety of
  43. systems, including a SGI Indy, Suns, a DEC Alpha and a m88k based Unix box.
  44.  
  45. 3. Installation
  46.  
  47. Please note: I know that the installation procedure could be improved. I
  48. always hate it if I have to change the Makefile or header files to install a
  49. program. But this is the best I could come up with so far.
  50.  
  51. To build UAE, first unpack it to an appropriate directory (e.g. /usr/src/uae
  52. on a Linux system). After that, you will have to edit the file config.h. There
  53. are many configuration options, each with a comment describing the purpose. 
  54. Please read everything carefully.
  55. Unlike in previous versions, you should not need to edit the Makefile.
  56. However, if X11 is installed in a different place on your system, you might
  57. need to change the "/usr/X11R6/" bits to "/usr/X11R5" or whatever is
  58. appropriate.
  59. The Makefile knows about a variety of systems. Do "make linux" to compile for
  60. the X Window System under Linux. Do "make svga" to use SVGAlib. There are
  61. several other systems: Do just "make" to get a list. If nothing else works, 
  62. try "make withgcc", and if that does not work because GCC is not installed, 
  63. "make generic". When that fails, send me an email.
  64. If you use SVGAlib, be warned that SVGAlib is not too stable and using it is 
  65. inherently a little dangerous, you might want to have a way to log in from a 
  66. remote terminal if things go horribly wrong. If you are very unfortunate, you 
  67. might lock up your machine otherwise (I strongly recommend using X - it is
  68. no longer much slower).
  69.  
  70. The compilation may take a while, especially for the cpu*.c files. There might
  71. be some warnings, ignore these. It may also take a lot of memory. You should 
  72. have at least 8MB physical RAM to compile this, plus maybe 20MB swap and 9MB 
  73. filesystem space.
  74.  
  75. After compilation, you'll need to install the ROM image. This must have a size
  76. of exactly 512K and should be an image of the addresses 0xF80000-0xFFFFFF on
  77. your Amiga system. The file must be called kick.rom to be recognized. Please
  78. read the next section on how to transfer files from your Amiga to your PC.
  79.  
  80. You can also install a disk image file. This must be called df0.adf (adf = 
  81. Amiga Disk File), and should be a raw image of the data on the floppy disk: 
  82. 11x2x80 sectors == 901120 bytes.
  83. Please try running UAE without a diskfile first. If everything went O.K., the
  84. emulator should show the Kickstart logo (don't be too impatient, this will
  85. take a while on slow machines).
  86.  
  87. If you don't have a Kickstart file, you may still be able to boot some games
  88. and demos. The emulator includes code that will try to read and execute the
  89. bootblock of the diskfile you are using, and if that bootblock only uses the
  90. one or two Kickstart functions that are supported by the "replacement
  91. Kickstart", your program will boot. Don't expect too much, though.
  92.  
  93. 4. Invoking UAE
  94.  
  95. After building the program, you should have an executable called "uae". You
  96. can simply execute it, but you can also optionally give it one of the following
  97. parameters:
  98.  
  99.  -d      : If UAE is not configured to use correct-aspect display by default, 
  100.            this option will enable it.
  101.  -f rate : Sets the frame rate
  102.  -D      : Don't start the emulator at once, use the built-in debugger.
  103.  -x      : (X Windows only) Enable a slower, but more portable version of the
  104.            drawing routines. If you need this switch, I'd like to hear about
  105.        it (it seems unlikely).
  106.  -l lang : Set the keyboard language at run-time. Currently, only two values
  107.            can be used for lang: "us" for U.S. keyboard (default), or "de" for
  108.        german keyboard.
  109.  -s      : Emulate slow memory at 0xC00000. This is known to cause problems,
  110.            there's a bug somewhere. But some demos expect to find this type
  111.        of memory, and they can occasionally be made to work with this
  112.        switch.
  113.  -S      : If you set the LINUX_SOUND option in config.h, you can turn off
  114.            sound output with this switch.
  115.  -M VOLUME:path
  116.  -m VOLUME:path
  117.            mount the unix file system at path as an Amiga filesystem with
  118.        volume name "VOLUME:". For example, "-M sound:/usr/amiga/modules"
  119.        If you use -M instead of -m, the volume will be read only.
  120.        See below.
  121.        
  122. If you use SVGAlib, the only way to leave the program is pressing F12.
  123.  
  124. 5. Harddisk emulation
  125.  
  126. Using diskfiles is awkward. There are two ways how you can use larger amounts 
  127. of data with UAE. 
  128.  
  129. a) Harddisk files.
  130. You can create a harddisk file with
  131.  
  132.   dd if=/dev/zero of=hardfile bs=512 count=16384
  133.   
  134. Currently, the size is fixed (8MB). This might be configurable in future
  135. versions.
  136. The harddisk file is accessed by a resident ROM module that is built into the
  137. emulator. It's called "uae.device", the DOS name for the harddisk is "uae0:".
  138. You have to format it before use (from AmigaDOS).
  139.  
  140. b) Access unix filesystems from the emulator.
  141.  
  142. This has some major advantages:
  143.  - It doesn't crash the emulator if you are using Kickstart 1.3
  144.  - It is more convenient.
  145.  - It is much faster. In fact, it can be dramatically faster even than a real
  146.    Amiga when reading directories.
  147.  
  148. If you specify the -M or -m command line arguments, you can use files on your
  149. Unix filesystem from the emulator. If you start UAE with
  150.  
  151.   uae -m sound:/usr/amiga/modules
  152.  
  153. you can access all the files in /usr/amiga/modules by reading from the
  154. AmigaDOS volume "SOUND:".
  155. If you want to execute files, they need to have the x permission bit set.
  156.  
  157. In theory, you can specify this option multiple times. In practice, this
  158. doesn't work with Kickstart 1.3 and was therefore turned off. This will get
  159. fixed.
  160.  
  161. 6. Tools
  162.  
  163. In the "amiga" subdirectory you'll find two small tools that you can use to
  164. transfer software from the Amiga to the PC. These are called transrom and
  165. transdisk. transrom will dump the contents of your Kickstart ROM, and
  166. transdisk will dump an image of the floppy in drive DF0:. Both programs write
  167. to the standard output, so you want to redirect that. Do
  168.  
  169.    transrom >ram:kick.rom
  170.    
  171. to create a file called "kick.rom" in the RAM disk, and
  172.  
  173.    transdisk >ram:df0.adf
  174.    
  175. to create a file called "df0.adf" in the RAM disk. These files are pretty
  176. big, 524288 bytes for the ROM image and 901120 bytes for a disk image. If you
  177. are short on RAM (less than 1.5MB) you may want to transfer those files 
  178. directly to a serial link between the Amiga and your Un*x system (works
  179. without a problem for me).
  180. transdisk can take extra arguments: A device name and unit number. If you do
  181.  
  182.   transdisk >ram:df1.adf trackdisk 1
  183.  
  184. the program will read the data from drive 1, not drive 0.
  185.  
  186. The current transdisk can only read the standard AmigaDOS format. You will 
  187. not be able to transfer copy protected disks. Although the current emulator
  188. version can handle a second type of disk file, and I have successfully
  189. transferred and run a copy protected game (Turrican I) on the emulator, this
  190. support is preliminary, and the disk file format for non-standard disk formats
  191. will probably change in future versions. If you also have Turrican and want 
  192. the program I used to transfer the disk, mail me.
  193.  
  194. If you transfer commercial software, you must not distribute the resulting
  195. image files, since that would be a violation of copyright law. The Kickstart
  196. ROM has to be considered commercial software. You may only use the Kickstart
  197. from your own Amiga, and you may not distribute Kickstart ROM files.
  198. Please read the license that came with your software for details.
  199.  
  200. If you have a disk image file, and you want to retrieve the files from it, you
  201. can use the "readdisk" tool. It is automatically built by "make". If you have
  202. a disk image of a disk called "Workbench1.3D" as df0.adf, and you do
  203.    readdisk df0.adf
  204. the whole directory structure of the disk image will be stored in a newly
  205. created subdirectory called "Workbench1.3D". You can optionally give a second
  206. parameter to specify a directory where to create the output other than the
  207. current directory.
  208.  
  209. 7. Quick overview of the debugger commands
  210.  
  211. If you use the X Windows version, you can press ^C at any time to enter the
  212. built-in MC68000 debugger.
  213. Each debugger command consists of a single letter and occasionally some
  214. parameters.
  215.  
  216. g:                    Start execution at the current address. 
  217. c:                    Dump state of the CIA and custom chips.
  218. r:                    Dump state of the CPU
  219. m <address> <lines>:  Memory dump starting at <address>
  220. d <address> <lines>:  Disassembly starting at <address>
  221. t:                    Step one instruction
  222. z:                    Step through one instruction - useful for JSR, DBRA etc.
  223. f <address>:          Step forward until PC == <address>
  224. q:                    Quit the emulator. You don't want to use this command.
  225.  
  226. While the emulator is running, you can interrupt it with a SIGINT signal (^C).
  227. (Don't do that in SVGAlib mode - use F12)
  228.  
  229. 8. Current state of UAE
  230.  
  231. The following parts are already mostly complete:
  232.   - MC68000 CPU: Almost done, some rare instructions are not emulated yet. 
  233.     I'd like to make this a 68020 emulation, but I need more info than I have
  234.     about the special registers (MMU etc.)
  235.     Maybe it will one day run Linux/68k!
  236.   - Blitter: If there's no bug, it ought to be complete.
  237.   - Timers: I think these are fully working, too.
  238.   - Copper: Not much to emulate here :-)
  239.   - Floppy disk: Standard AmigaDOS disks seem to work O.K., some special
  240.     formats can be made to work (not yet really supported).
  241.   - Playfield (display) hardware: Normal cases are working, as well as
  242.     dual playfields, EHB and HAM and interlace (interlace only with correct 
  243.     aspect)
  244.   - Mouse, Keyboard, Joystick: Mouse and joystick should be autocalibrating.
  245.     Only DE and US are supported as keyboard languages.
  246.   - Sprites: Still one or two bugs, but usually working.
  247.   - Sound: Some support (Linux only). Not too useful right now. See below.
  248.  
  249. Not done:
  250.   - "System control hardware": That's what the HRM calls sprite/playfield
  251.     collisions/priorities. Only the most common priority settings are
  252.     implemented.
  253.   - Timing: It does not really behave like a real A500, but I don't think
  254.     complete accuracy is necessary.
  255.  
  256. 9. Input devices
  257.  
  258. Currently, the keyboard mapping used in the emulator is valid only for a
  259. german keyboard. On other keyboards, some keys will be missing - sorry. If you
  260. fix this for your national keyboard, I'd appreciate if you could send me a
  261. patch. There are some beginnings of US keyboard support in the source.
  262. The left and right mouse buttons are emulated. If you have a three button
  263. mouse, the middle button will be the joystick button.
  264. Mouse movement is reported to the emulated Amiga. In SVGAlib, you'll have no
  265. problem positioning the mouse. In X Windows, the emulator defaults to a
  266. special mode in which the mouse movement is adjusted so that sprite 0 and X
  267. mouse pointer are located at the same position. If this should cause problems,
  268. you can turn it off with F12.
  269. If you use Linux and have the joystick driver kernel module, you can configure
  270. UAE to use it. The joystick should be autocalibrating. Turn it a few times on
  271. startup to get the calibration done. If this causes any problems, let me know.
  272.  
  273. 10. Sound
  274.  
  275. You probably noticed the LINUX_SOUND configuration option. If defined, this
  276. will make the emulator use /dev/dsp to output sound with 16 bit, at a frequency
  277. of 44100KHz. Your soundcard has to support this rate. If it does not, your
  278. results will be unpredictable.
  279. If graphics output is enabled while sound is output, the emulator will be much
  280. too slow on all current systems. The sound will not be continuous. Therefore,
  281. a hack to turn off screen updates is provided: Press ScrollLock to disable
  282. graphics, press it again to enable them (note: for X, you'll have to press it
  283. twice each time).
  284. The LINUX_SOUND_SLOW_MACHINE option will steal cycles from the CPU emulator.
  285. The relative CPU speed will be reduced somewhat if this option is set. This may
  286. lead to incompatibilities. The system should not be heavily loaded (no blitter
  287. or disk activity) while sound is being played, or even this will be too slow.
  288. Only a subset of the Amiga sound hardware is emulated. Attached channels are
  289. not implemented, neither is CPU-driven output.
  290.  
  291. Currently, this implementation is good enough to play *Tracker modules and
  292. some game title melodies. It is fast enough (on a P90) to play modules using a
  293. Workbench player program if no other (Amiga) processes are active. 
  294.  
  295. 11. Speed
  296.  
  297. A Pentium with about 500MHz would be nice... (*)
  298. but even a Pentium-90 is not that bad, if you set the frame rate to a high
  299. value, e.g. 9. Animations will not be smooth if not all frames are drawn, but
  300. the speed of the emulation will be considerably higher.
  301. The speed of the emulation is not fixed. Programs that make heavy use of 
  302. blitter, copper and disk DMA will run somewhat slower than programs that only
  303. use the CPU. More bitplanes and sprites will also slow things down. The speed
  304. also depends very much on configuration options.
  305. UAE can calculate the average time it needs to finish one Amiga frame. Use the
  306. 'c' debugging command. If you use SVGAlib, the average frame rate will be
  307. displayed when you exit UAE, provided the library doesn't mess up your
  308. text-mode screen when you exit.
  309. Here's a small table of various systems (running random programs, all values 
  310. may vary about +/-20 ). Configuration is in the format 
  311. "display/#colors/frame rate/aspect". A real A500 has a fixed frame rate of
  312. 20ms.
  313.  
  314. Note: For SVGAlib, there is no big difference whether you use the right aspect
  315. or not, so these figures have been omitted.
  316.  
  317. Configuration             i486   P90    HP
  318. SVGAlib/256/5/n                !  50 !
  319. SVGAlib/256/1/n                ! 100 !
  320. SVGAlib/65536/5/n          130 !  60 !
  321. SVGAlib/65536/1/n          300 ! 120 !
  322. X, 256/5/n                     !     ! 
  323. X, 65536/5/n                   !  60 !
  324. X, 256/1/n                     !     !  
  325. X, 65536/1/y                   ! 200 !
  326.  
  327. Systems:
  328. i486: i486-DX2-66, VLB
  329. P90: Pentium-90, PCI
  330. HP: HP Apollo 9000/720
  331.  
  332. So, if you configure for maximum speed, a Pentium-90 will be 5 times slower
  333. than a real A500 at full frame rate. If you reduce the frame rate, is about
  334. 2-3 times slower.
  335.  
  336. (*) Try buying a 500MHz clock and a fire extinguisher :-)
  337.  
  338. 12. Future projects
  339.  
  340. A lot of things can still be added to make this program more useful, and I 
  341. can't do everything at the same time. So, any help is welcome to speed up 
  342. the development of this program. If you have written an Amiga program and it
  343. does not work with the emulator, it would help tremendously if you could try 
  344. to figure out why it's incompatible.
  345. If you fix any bugs or implement new features, please mail me any of these
  346. enhancements (see below for address). If they are any good, I will include 
  347. them into a new version of the emulator. You'll be credited for any of your 
  348. changes that make it into the source. Any format that suits you is welcome, 
  349. but "diff -u" output is preferred.
  350. Of course, no one is obliged to do any work on UAE. I'll eventually get around
  351. to implement all the stuff I want to have. If you are just enjoying this 
  352. program, you are doing what it was written for.
  353.  
  354. Various approaches how to write an Amiga emulator have been discussed in
  355. comp.emulators.misc, comp.emulators.cbm and comp.sys.amiga.emulations. This
  356. implementation tries to emulate the behaviour of the Amiga hardware. This
  357. hardware is supposed to be a PAL A500 with Old Chipset. Any Kickstart version
  358. can be used, and any amount of chipmem (256K - 2MB) can be configured.
  359. Extending this to ECS should be no problem (although I don't really see the
  360. point - the emulator can already handle 2MB chip, which is the best thing 
  361. about ECS), a 68020 emulation should be possible as well, AGA may be tricky due
  362. to lack of documentation.
  363.  
  364. 13. Frequently Asked Questions
  365.  
  366. Q: Will there be a Windows version?
  367. A: I'll never write a non-commercial program for DOS/Windows again. I hate
  368.    having to reboot after mistakes.
  369.    The odds are *very* low.
  370.  
  371. Q: I get lots of compilation errors. Why?
  372. A: The most popular reason is a missing libg.sa in /usr/lib (Slackware bug).
  373.    Do "cd /usr/lib; ln -s libc.sa libg.sa".
  374.    Another possibility is that you botched your system in an ELF upgrade.
  375.    Check whether GCC, binutils, libc, ld.so, X11 etc. are all uptodate and 
  376.    installed for the same binary format.
  377.  
  378. Q: How can I change diskfiles?
  379. A: Wait for version 0.5.
  380.  
  381. Q: Is it possible to read Amiga disks with a PC?
  382. A: Ask that in comp.emulators.misc :-) The answer is: NO! Unless you invent
  383.    and build some extra hardware yourself, which no one appears to have done
  384.    yet.
  385.  
  386. Q: When it starts up, it says "Illegal instruction: 4e7b". Why?
  387. A: That's normal, it's just the Kickstart CPU type test.
  388.  
  389. Q: Why is there a blank area on the left side of the screen?
  390. A: The Amiga can display graphics there, but usually doesn't because this
  391.    would disable some sprites. The area is only used by some overscan demos.
  392.    Normal screens are off-center.
  393.  
  394. Q: Benchmark program <foo> gives weird results.
  395. A: Amiga programs run by the emulator think the Amiga timers can be used to
  396.    measure real time. But in UAE, they only measure "emulation time". Sysinfo,
  397.    for example, gives the same results on all machines. So don't run
  398.    benchmarks to test the emulator speed.
  399.  
  400. Q: Wasn't this called the Unusable Amiga Emulator?
  401. A: Yes. But no one thought the name was very fitting anymore, though. It was
  402.    only really appropriate for v0.1, which couldn't even boot.
  403.    
  404. 14. Thanks & Acknowledgements
  405.  
  406. Thanks to all who have written me so far with bugreports and success/failure
  407. reports when trying to run the emulator on various hardware with different
  408. Kickstart versions.
  409.  
  410. Special thanks (in no particular order) to:
  411.   - Jay Miner, Dale Luck, R.J. Mical and all the others who built the Amiga.
  412.   - Felix Bardos, whose HRM I "borrowed".
  413.   - Alessandro Bissacco: X Windows mouse auto-calibration, battclock emulation
  414.     and various bugfixes.
  415.   - Hannu Rummukainen: Floppy write emulation.
  416.   - Andre Beck: Made the X support much faster by using MIT-SHM extensions.
  417.     (Not bad for a 10 minute hack, Andre!)
  418.   - Ed Hanway: Wrote the unixfs.device. Improvements to the X support (cursor 
  419.     blanking, etc.), lots of SGI compatibility fixes, run time options. He 
  420.     also sent me a copy of his own (unfinished) Amiga emulator...
  421.   - Ernesto Corvi: Mac port
  422.   - Denis Sablic: Misc. bugfixes, "-S" runtime option.
  423.   - Marcus Sundberg: Better transdisk, bugfixes, DEC Alpha diagnostics.
  424.   
  425. 15. The author's address
  426.  
  427. crux@pool.informatik.rwth-aachen.de
  428.  
  429. or, via snailmail
  430.  
  431. Bernd Schmidt
  432. Schlossweiherstrasse 14
  433. 52072 Aachen
  434. Germany
  435.  
  436. I'll *try* to reply to everyone who sends me mail. Email has a near 100%
  437. chance of being replied, although I've been getting quite a lot of it
  438. recently. I can't make any guarantees about snailmail.
  439.  
  440. I have set up a WEB page for UAE. You might find interim versions, Linux
  441. binaries, diskfiles with Amiga software and other interesting stuff there.
  442. Then again, you might not. My quota isn't that big. The address is
  443.  
  444. http://www-users.informatik.rwth-aachen.de/~crux/uae.html
  445.